#define _CRT_SECURE_NO_WARNINGS 1

#include"list.h"
#include<vector>
#include<string>

namespace sxn
{
	void test1()
	{
		list<int> ls1;
		ls1.push_back(1);
 		ls1.push_back(2);
		ls1.push_back(3);
		ls1.push_back(4);
		list<int> ls2 = ls1;
		ls2.erase(ls2.begin());
		list<int>::iterator it = ls2.begin();
		int* p = it.operator->();
		std::cout << *p << " ";

		//ls2.erase(--ls2.end());
		//const list<int> ls2 = ls1;

		for (auto i : ls2)
		{
			std::cout << i << " ";
		}
	}
	void test2()
	{
		list<int> ls1;
		ls1.push_back(1);
		ls1.push_back(2);
		ls1.push_back(3);
		ls1.push_back(4);
		list<int> ls2;
		ls2.push_back(6);
		ls2.push_back(6);
		ls2.push_back(6);
		ls2.push_back(6);
		ls2.push_back(6);
		ls2.push_back(6);
		ls2 = ls1;
		const list<int> ls3(ls2);
		//ls2.clear();
		for (auto i : ls3)
		{
			std::cout << i << " ";
		}
	}

	void test3()
	{
		list<int> ls1;
		ls1.push_back(1);
		ls1.push_back(2);
		ls1.push_back(3);
		ls1.push_back(4);
		std::vector<int> v(10, 9);
		const list<int> ls2(v.begin(), v.end());
		//ls2.clear();
		for (auto i : ls2)
		{
			std::cout << i << " ";
		}
	}
	void test4()
	{
		list<std::string> ls;
		ls.push_back("zzzz");
		ls.push_back("zzzz");
		ls.push_back("zzzz");
		ls.push_back("zzzz");
		ls.push_back("zzzz");
		ls.push_back("zzzz");

		const list<std::string> ls1(ls);
		for (auto i : ls1)
		{
			std::cout << i << " ";
		}
	}
}

int main()
{
	sxn::test4();
	return 0;
}